﻿@model UA.Data.Model.User
@{
    ViewBag.Title = "Manage";
}

<h2>个人信息管理页面 - Manage</h2>
<hr />
<script type="text/javascript">
    $(function () {
        var msg = "@ViewBag.Message";
        if (msg) {
            $.messager.show({ title: "操作提醒", msg: msg });
        }

        $("#editForm").submit(function () {
            return $(this).form("validate");
        });

        $("#btnSubmit").click(function () {
            $("#editForm").submit();
        });

        $("#btnReset").click(function () {
            $("#editForm").form("reset");
        });

        $("#btnCancel").click(function () {
            window.history.go(-1);
        });
    });
</script>
<div class="easyui-window" data-options="title: '个人信息编辑', width: 400, height: 280, left: 80, top: 100, collapsible: true">
    @using (@Html.BeginForm("Manage", "Account", FormMethod.Post, new { id = "editForm", @class = "edit-form" }))
    {
        @Html.AntiForgeryToken()
        <p>
            @Html.LabelFor(m => m.Code)
            @Html.TextBoxFor(m => m.Code, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[3, 32]'" } })
        </p>
        <p>
            @Html.LabelFor(m => m.Name)
            @Html.TextBoxFor(m => m.Name, new Dictionary<string, object>() { { "class", "easyui-textbox" }, { "data-options", "required: true, validType: 'length[1, 32]'" } })
        </p>
        <p>
            @Html.LabelFor(m => m.Sex)
            @Html.EnumDropDownListFor(m => m.Sex, new Dictionary<string, object>() { { "class", "easyui-combobox" }, { "data-options", "editable: false, width: 80" } })
        </p>
        <p>
            @Html.LabelFor(m => m.Birthday)
            @Html.TextBoxFor(m => m.Birthday, new Dictionary<string, object>() { { "class", "easyui-datebox" }, { "data-options", "editable: false, value: '" + (Model.Birthday.HasValue ? Model.Birthday.Value.ToString("yyyy-MM-dd") : "") + "'" } })
        </p>
        <hr />
        <p>
            <input id="btnSubmit" type="button" value="确定" />
            <input id="btnReset" type="button" value="重置" />
            <input id="btnCancel" type="button" value="取消" />
        </p>
    }
</div>



